package com.yh.wcx.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.yh.wcx.entity.User;
import com.yh.wcx.mapper.UserMapper;
import com.yh.wcx.service.UserService;
import com.yh.wcx.to.UserTo;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User login(UserTo userTo) {
        User user = BeanUtil.copyProperties(userTo, User.class);
        return userMapper.loign(user);
    }
}
